﻿#pragma once

#include "Define.h"
#include "Log.h"
#include "Core/Events/Event.h"

namespace Origin
{
    struct WindowProps
    {
        // 结构体默认是public
        std::string title;
        unsigned int width;
        unsigned int height;

        WindowProps(
            const std::string& title = "Origin", 
            unsigned int width = 1280, 
            unsigned int height = 720):title(title), width(width), height(height)
        {
        }
    };

    class ORIGIN_API Window
    {
    public:
        using EventCallbackFn = std::function<void(Event&)>;

        // 使用T()显示初始化
        static Window* Create(const WindowProps& props = WindowProps());
        inline virtual void* GetNativeWindow() const = 0;
        
        virtual ~Window() = default;

        virtual void OnUpdate() = 0;
        virtual void SetSync(bool enabled) = 0;
        virtual void Shutdown() = 0;
        virtual void SetEventCallback(const EventCallbackFn callback) = 0;
        virtual unsigned int GetWidth() = 0;
        virtual unsigned int GetHeight() = 0;

    };
}